using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Abp.Application.Services.Dto;
using Abp.AspNetCore.Mvc.Authorization;
using Abp.Runtime.Validation;
using AutoMapper;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Xwy.MyProject.Authorization;
using Xwy.MyProject.Controllers;
using Xwy.MyProject.Reservations;
using Xwy.MyProject.Reservations.Dto;

namespace Xwy.MyProject.Web.Controllers
{
    //[AbpMvcAuthorize(PermissionNames.Pages_Reservations)]
    [AbpMvcAuthorize]
    public class ReservationsController : MyProjectControllerBase
    {
        private readonly IReservationAppService _reservationAppService;

        public ReservationsController(IReservationAppService reservationAppService)
        {
            _reservationAppService = reservationAppService;
        }

        public ActionResult Index() 
        {
           
            return View();
        }

        public async Task<ActionResult> EditModal(long reservationId)
        {
            var reservationDto = await _reservationAppService.GetAsync(new EntityDto<long>(reservationId));
            return PartialView("_EditModal", reservationDto);
        }
    }
}
